@extends('backend::layout')
@section('title',trans($page_title))
@section('content')
    @if(isset($search))
        {{$search->render()}}
    @endif
    @component('backend::component.table.table-content')
        @slot('page_title') {{$page_title}} @endslot
        @slot('tools_btn')

            @component('backend::component.form.button')
                @slot('title') 导出订单 @endslot
                @slot('attr') onclick=searchExport(this) @endslot
                @slot('color') info @endslot
                @slot('icon') hcl-export @endslot
                @slot('params'){"url":"{{route('b_ShopOrder_exportOrder',['status'=>$status??-100])}}","method":"post","title":"批量导出","targetData":".id","confirm":"true"} @endslot
            @endcomponent
        @endslot
        @slot('body_content')
            @if($list->isNotEmpty())
                <table class="list table table-bordered table-striped">
                    <thead>
                    <tr>
                        <th>
                            @component('backend::component.checkbox')
                                @slot('name') ids-all @endslot
                            @endcomponent
                        </th>
                        <th>订单号</th><th>用户账号</th><th>订单金额</th><th>所属区</th>
                        <th>支付方式</th><th>订单状态</th><th>下单时间</th><th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($list as $value)
                        <tr>
                            <td>
                                @component('backend::component.checkbox')
                                    @slot('name') ids[] @endslot
                                    @slot('class') id @endslot
                                    @slot('value') {{$value->order_id}} @endslot
                                @endcomponent
                            </td>
                            <td>{{$value->order_sn}}</td>
                           {{-- <td>{{$value->user->user_number}}</td>--}}
                            <td class="text-truncate text-more-hide">
                                账户:{{$value->user->user_number}}<br/>
                                {{$value->user->real_name}}<br/>
                                {{$value->user->user_phone}}
                            </td>
                            <td>
                                支付金额:{{$value->total_price}}<br/>
                                订单金额:{{$value->goods_price}}
                            </td>
                            <td>{{config('shop.zone')[$value->goods_zone]}}</td>
                            <td>{{config('shop.pay_type')[$value->pay_type]}}</td>
                            <td>{{config('shop.order_status')[$value->status]}}</td>
                            <td>{{$value->created_at}}</td>
                            <td>
                                @if($value->status > -1)
                                    @component('backend::component.form.button')
                                        @slot('title') 关闭订单 @endslot
                                        @slot('icon') hcl-circle-del @endslot
                                        @slot('color') danger @endslot
                                        @slot('params') {"url":"{{route('b_ShopOrder_close',['order_id'=>$value->order_id])}}","confirm":"true"} @endslot
                                        @slot('class') btn-ajax @endslot
                                    @endcomponent
                                @endif
                                @component('backend::component.form.button-group')
                                    @slot('button_title')
                                        @component('backend::component.form.button')
                                            @slot('title') 更多 @endslot
                                            @slot('color') primary @endslot
                                            @slot('size') sm @endslot
                                            @slot('icon') hcl-more @endslot
                                            @slot('class') dropdown-toggle @endslot
                                            @slot('attr') data-toggle=dropdown @endslot
                                        @endcomponent
                                    @endslot
                                    @slot('button_item')
                                        @component('backend::component.form.button')
                                            @slot('title') 订单详情 @endslot
                                            @slot('elem') a @endslot
                                            @slot('class') dropdown-item @endslot
                                            @slot('href') {{route('b_ShopOrder_detail',['order_id'=>$value->order_id])}} @endslot
                                        @endcomponent
                                    @endslot
                                @endcomponent

                            </td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
                @slot('list_page')
                    {{$list->appends($search->getSearchData())->links('backend::public.pagination')}}
                @endslot
            @else
                @component('backend::public.empty_page')
                    @slot('info') 暂时没有订单 @endslot
                @endcomponent
            @endif
        @endslot
    @endcomponent
@endsection